
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>

<chiptrack:checkLogon sourcePage="/approveQuotation.do"/>

<%
    String chipTracContext = "/" + ConfigManager.getChipTracContext();
    int i=0;
    String selectedMethod = null;
    String selectedAccount = null;
%>

<%@page import="com.scalar.chiptrack.utils.ConfigManager,
                  com.scalar.chiptrack.commons.SessionKeys,
                  com.scalar.chiptrack.commons.Constants,
                  com.scalar.chiptrack.users.User,
                  com.scalar.chiptrack.users.Functionality,
                  com.scalar.chiptrack.utils.StringUtils,
                  com.scalar.chiptrack.sales.LineItem,
                com.scalar.chiptrack.sales.forms.quote.QuotationForm" %>

<HTML><HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type="text/css" rel="stylesheet">
<script src="<%=chipTracContext%>/jsp/includes/scripts/functions.js"></script>
<SCRIPT language="JavaScript" src="<%=chipTracContext%>/jsp/includes/scripts/validations.js"></script>

<SCRIPT language="JavaScript">
    if (document.layers)
        window.setResizable(false);
    var count = <%= (String)request.getAttribute("maxLineItemNo") %>

    var errors = "";
   function addTextArea()
   {

        var htmltext = '<div><table border="0" width="95%"><tr><td width="7%" bgcolor="#DEE1E2">';
        htmltext = htmltext + '<input type="text" name="lineItemNo" value="'+count+'" size=6 class="txfield" disabled="true"></td>';
        htmltext = htmltext + '<input type="hidden" name="lineItemNo" value="'+count+'">';

        htmltext = htmltext + '<input type="hidden" name="jsLineItemNo" value="'+count+'">';

        htmltext = htmltext + '<td width="7%" bgcolor="#DEE1E2">';
        htmltext = htmltext + '<input type="text" name="poLineItemNo" value="'+count+'" size=6 class="txfield" disabled="true">';
        htmltext = htmltext + '</td>';
        htmltext = htmltext + '<input type="hidden" name="poLineItemNo" value="'+count+'">';
        htmltext = htmltext + '<input type="hidden" name="lineItemId" value="-1">';


        htmltext = htmltext + '<td width="15%" bgcolor="#DEE1E2">';
        htmltext = htmltext + '<select name="manufacturingPartNo" class="txfield" onchange="getComments('+(count-1)+')"><option value="" ></option>';

        <%

           java.util.ArrayList optionlist = null;
           org.apache.struts.util.LabelValueBean option = null;
           StringBuffer strBuffer = null;
           try{
               optionlist = (java.util.ArrayList)request.getAttribute("mfgParts");
               if(optionlist==null) optionlist = new java.util.ArrayList();
               int optionlistsize = optionlist.size();
               strBuffer = new StringBuffer();
               for(int cnt=0;cnt<optionlistsize;cnt++)
               {
                   option = (org.apache.struts.util.LabelValueBean)optionlist.get(cnt);
                   strBuffer.append("htmltext = htmltext + '");
                  strBuffer.append("<option value=\"").append(option.getLabel()).append("\">");
                  strBuffer.append(option.getLabel()).append("</option>';\n");
               }
                 out.println(strBuffer);
              }
              catch(Exception ex)
              {

                  System.out.println(ex);
              }
        %>
        htmltext = htmltext + '</select></td>';
        htmltext = htmltext + '<td width="10%" bgcolor="#DEE1E2">';
        htmltext = htmltext + '<textarea name="lineItemDescription" class="txfield"></textarea></td>';
        htmltext = htmltext + '<td width="1%" bgcolor="#DEE1E2"> &nbsp;&nbsp;&nbsp;';
        htmltext = htmltext + '<input type=checkbox name="isTaxable'+count+'">&nbsp;&nbsp;&nbsp;</td>';
        htmltext = htmltext + '<td width="18%" bgcolor="#DEE1E2">';
        htmltext = htmltext + '<input type="text" name="requestDate" size=15 class="txfield"></td>';
        htmltext = htmltext + '<td width="5%" bgcolor="#DEE1E2">';
        htmltext = htmltext + '<input type="text" name="quantity" size=8 class="valuetxfield" value="0" onchange="javascript:isValidInteger(this);"></td>';

        htmltext = htmltext + '<input type="hidden" name="oldQty" value="0">';

        htmltext = htmltext + '<td width="15%" bgcolor="#DEE1E2">';
        htmltext = htmltext + '<input type="text" name="unitPriceAsDouble" size=13 class="valuetxfield" value="0.0"></td>';
        htmltext = htmltext + '<td width="15%" bgcolor="#DEE1E2">';
        htmltext = htmltext + '<input type="text" name="amount" size=25 class="valuetxfield" value="$0.00" disabled="true"></td></tr></table></div>';

        var pa=document.getElementById("font1");
        pa.insertAdjacentHTML('BeforeEnd',htmltext);
        count++;

    }

    function AddNewShippingAddress(addElement)
    {
        //Restricting the user from entering more than one new shipping address
        var pa = document.getElementById("errors");
        pa.innerHTML = "";

        for(var i=0;i< document.QuotationForm.shippingAddressId.length; i++) {
            if(document.QuotationForm.shippingAddressId[i].value == -1){
                pa.innerHTML = "Cannot add more then one new Shipping Address";
                return;
            }
        }


        shipElement = addElement.name;
        newWindow = window.open('addAddress.do?action=AddShippingAddress','optionsPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=yes,width=400,height=400,left=550,top=180,resizable=no');

  	    newWindow.focus();
    }

    function assignShippingAddress(elementName)
    {
        var len = elementName.length;
        var temp = "";
        for(var i=0;i< len; i++) {
            if(elementName.options[i].value == elementName.value)
                temp = temp + elementName.options[i].innerText + "\n";
        }
        document.QuotationForm.shippingAddress.value  = temp;
    }


    //Function for adding a new option to the shippingAddressId select list
    function addShippingAddressIdOption(optionContent,optionValue)
    {
        document.QuotationForm.shippingAddressId.add(new Option(optionContent,optionValue));
    }

    function taxFocus()
    {
         document.QuotationForm.newSalesTax.focus();
    }

    var flag = true;
    function addNewSalesTaxType(statename)
    {
          if(statename.value == -1)
          {
          	  if(flag == true)
                 {

          	     var htmltext1 = '<font class="NArialL">New State :</font>&nbsp;'
       		     var htmltext2 = '<input type="text" name="newSalesState" size="18" maxlength="25" class="txfield" onblur ="javascript:taxFocus();" >'
       		     var htmltext3 = '<font class="NArialL">New Tax :</font>&nbsp;'
       		     var htmltext4 = '<input type="text" name="newSalesTax" size="18" maxlength="25" class="txfield">'

       		     var p1=document.getElementById("font-1");
       		     var p2=document.getElementById("font-2");

       		     p1.insertAdjacentHTML('BeforeEnd',htmltext1);
       		     p2.insertAdjacentHTML('BeforeEnd',htmltext2);

       		     var p3=document.getElementById("font-3");
       		     var p4=document.getElementById("font-4");

       		     p3.insertAdjacentHTML('BeforeEnd',htmltext3);
       		     p4.insertAdjacentHTML('BeforeEnd',htmltext4);


       		     flag = false;
       		}
          }

     }

    function assignShippingAccount(elementName)
    {
        var len = elementName.length;

        for(var i=0; i< len; i++){
             if(elementName.options[i].selected){
                document.QuotationForm.shippingMethodName.value = elementName.options[i].innerText;

             }
        }

        document.QuotationForm.shippingAccount.value = elementName.value;

    }


    function isValidInteger(temp)
    {
        errors = "";
        if(!isInteger(temp.value)) {
            errors = "Please enter a valid integer";
        }
        var pa=document.getElementById("errors");
        pa.innerHTML = errors;

        return;

    }


    function dateValidation()
    {
		var dateValue = "";
	    var temp = document.QuotationForm["requestDate"];

         if ( temp.length == null )
         {
           if( chkDate(temp.value,"Requested Dock Date","Y") == false)
			{
				errors = errMsg;
				temp.select();
				temp.focus();
			}
			else
			{
				return false;
			}


        }
	else{
		var partNo = document.QuotationForm["manufacturingPartNo"];
		var i;
		for( i=0; i< temp.length; i++)
		{
			if(partNo[i].value != '')
            {
				if( chkDate(temp[i].value,"Requested Dock Date ","Y") == false)
				{
					errors = errMsg;
					temp[i].select();
					temp[i].focus();
					break;
				}

		    }
          }

     }

        if(errors != '')
            return false;
        else
            return true;
    }

    function validateRequestDate(temp)
     {
            errors = "";
            validateDate(temp.value);
            var pa=document.getElementById("errors");
            pa.innerHTML = errors;

    	return;
        }


    function submitPage(action)
    {
       errors = "";
       document.QuotationForm.action.value='approveQuotation';

       /*for ( lineItemNo=1; lineItemNo < count; lineItemNo++ )
       {
            var approveChkbox = document.getElementById('isApproved'+lineItemNo)
            if (  approveChkbox != null && approveChkbox != 'undefined' && approveChkbox.disabled == false && approveChkbox.checked )
            {
                var leadTimeCtrl=document.getElementById('leadTime'+lineItemNo);
                if ( leadTimeCtrl.value == 0 )
                {
                    errors = "<li>  Please select Lead Time";
                    leadTimeCtrl.focus();
                    break;
                }
            }
        }*/

        if ( errors != "" )
        {
            var pa=document.getElementById("errors");
            pa.innerHTML = errors;
        }
        else
        {
            document.QuotationForm.submit();
        }
    }


       function getComments(selecteditem)
       {
           var form = document.QuotationForm;
           var mfPartNo;
           var size;
           size = keys.length;
           var lineitems = count;
           if( lineitems > 2 )
           {
               mfPartNo = form.manufacturingPartNo[selecteditem].value;
               mfPartNo = trim(mfPartNo.toLowerCase());

               for(i=0; i < size; i++)
               {

                    if( mfPartNo == trim(keys[i].toLowerCase()) && comments[i] != 'null')
                    {
                        form.lineItemDescription[selecteditem].value = comments[i];
                        break;
                    }
                    else
                    {
                        form.lineItemDescription[selecteditem].value = "";
                    }
               }
           }
           else
           {
                mfPartNo = form.manufacturingPartNo.value;
                mfPartNo = trim(mfPartNo.toLowerCase());

                for(j=0; j < size; j++)
                {
                    if( mfPartNo == trim(keys[j].toLowerCase()) && comments[j] != 'null')
                    {
                        form.lineItemDescription.value = comments[j];
                        break;
                    }
                    else
                    {
                        form.lineItemDescription.value = "";
                    }
                }
           }
        }
       var keys = new Array();
       var comments = new Array();
    <%
           java.util.HashMap mapComments = null;
           try{
                   mapComments = (java.util.HashMap)request.getAttribute("mfgPartsWithComments");
                   java.util.Iterator mapKeyIterator = mapComments.keySet().iterator();
                   int count = 0;
                   strBuffer = new StringBuffer();
                   while( mapKeyIterator.hasNext() )
                   {
                       Object key = mapKeyIterator.next();
                       strBuffer.append("keys[").append(count).append("]='").append(key).append("';\n");
                       out.print( "comments["+count+"]='");
                       if(mapComments.get(key)!=null){
                          out.print(StringUtils.escapeSpecialString((String)mapComments.get(key)) );
                       }
                       out.println("';");
                       count++;
                   }
              out.println(strBuffer.toString());
              }
              catch(Exception ex)
              {

                  System.out.println(ex);
              }
        %>


    function showErrorReportPage()
    {
        newWindow = window.open ('<%=chipTracContext%>/reportProblem.do','reportProblem','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=no,width=750,height=400,resizable=no');
        newWindow.focus();
    }


    function enableDisableFields( lineItemNo )
    {
        var form = document.QuotationForm;
        var approveChkbox = document.getElementById( "isApproved"+ lineItemNo );
        var leadTimeCtrl = document.getElementById( "leadTime"+ lineItemNo );
        if ( approveChkbox.checked )
        {
            leadTimeCtrl.disabled = false;
        }
        else
        {
            leadTimeCtrl.disabled = true;
        }
    }

    function resetForm ()
    {
        var form = document.QuotationForm;
        form.reset();

        for ( lineItemNo=1; lineItemNo <= count; lineItemNo++ )
        {
            var approveChkbox = document.getElementById( "isApproved"+ lineItemNo );
            if (  approveChkbox != null && approveChkbox != 'undefined' && approveChkbox.disabled == false )
                enableDisableFields(lineItemNo);
        }
    }
    function quotationDetails( qNumb, qDate, endCus, newEndCus, endUser, newEndUser, partNumber, qty, price, salesorderNo, shipDate, scheduleDate)
    {
        this.qNumb = qNumb;
        this.qDate = qDate;
        this.endCus = endCus;
        this.newEndCus = newEndCus;
        this.endUser = endUser;
        this.newEndUser = newEndUser;
        this.pNumber = partNumber;
        this.qty = qty;
        this.price = price;
        this.salesorderNo= salesorderNo;
        this.shipDate = shipDate;
        this.scheduleDate = scheduleDate;
    }
    var qa = new Array();
    var qaPrice = new Array();
    var qaCommitments = new Array();
    <logic:present name="prevQuotationsList">
    <logic:iterate id="prevQuotation" name="prevQuotationsList" type="com.scalar.chiptrack.sales.PreviousQuotationDetails" indexId="idx">
        qa[<%=idx.intValue()%>] = new quotationDetails('<bean:write name="prevQuotation" property="quotationNo"/>','<bean:write name="prevQuotation" property="quotationDate"/>', '<bean:write name="prevQuotation" property="endCustomerName"/>', '<bean:write name="prevQuotation" property="newEndCustomerName"/>', '<bean:write name="prevQuotation" property="endUserName"/>', '<bean:write name="prevQuotation" property="newEndUserName"/>', '<bean:write name="prevQuotation" property="partNumber"/>', '<bean:write name="prevQuotation" property="qty"/>','<bean:write name="prevQuotation" property="unitCost"/>', 'Previous Quotaton Details');
    </logic:iterate>
    </logic:present>
    <logic:present name="prevQuotationPriceList">
    <logic:iterate id="prevQuotationPrice" name="prevQuotationPriceList" type="com.scalar.chiptrack.sales.PreviousQuotationDetails" indexId="idx1">
          qaPrice[<%=idx1.intValue()%>] = new quotationDetails('<bean:write name="prevQuotationPrice" property="quotationNo"/>','<bean:write name="prevQuotationPrice" property="quotationDate"/>', '<bean:write name="prevQuotationPrice" property="endCustomerName"/>', '<bean:write name="prevQuotationPrice" property="newEndCustomerName"/>', '<bean:write name="prevQuotationPrice" property="endUserName"/>', '<bean:write name="prevQuotationPrice" property="newEndUserName"/>', '<bean:write name="prevQuotationPrice" property="partNumber"/>', '<bean:write name="prevQuotationPrice" property="qty"/>','<bean:write name="prevQuotationPrice" property="unitCost"/>', 'Latest Price Details In Quotations');
    </logic:iterate>
    </logic:present>
     <logic:present name="prevCommitmentsDetails">
    <logic:iterate id="prevCommitments" name="prevCommitmentsDetails" type="com.scalar.chiptrack.sales.PreviousQuotationDetails" indexId="idx1">
            qaCommitments[<%=idx1.intValue()%>] = new quotationDetails('<bean:write name="prevCommitments" property="quotationNo"/>','<bean:write name="prevCommitments" property="quotationDate"/>', '<bean:write name="prevCommitments" property="endCustomerName"/>', '<bean:write name="prevCommitments" property="newEndCustomerName"/>', '<bean:write name="prevCommitments" property="endUserName"/>', '<bean:write name="prevCommitments" property="newEndUserName"/>', '<bean:write name="prevCommitments" property="partNumber"/>', '<bean:write name="prevCommitments" property="qty"/>','<bean:write name="prevCommitments" property="backlogQty"/>', '<bean:write name="prevCommitments" property="salesOrderNo"/>', '<bean:write name="prevCommitments" property="shipDate"/>', '<bean:write name="prevCommitments" property="scheduleDate"/>');
    </logic:iterate>
    </logic:present>
    function loadQuotationsQuestionnaire()
    {
       newWindow = window.open('<%=chipTracContext%>/jsp/sales/quote/quotaton_questionnaire_view.jsp','optionsPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=yes,scrollbars=yes,width=900,height=700,left=100,top=50,resizable=yes');
       newWindow.focus();
    }

</SCRIPT>
</HEAD>
<BODY bgColor="#ffffff" leftMargin=0 topMargin=0 marginheight="0" marginwidth="0" >

<%@ include file="/jsp/includes/header.jsp" %>

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
    <TBODY>
    <TR>
        <TD width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>
            <!-- Side Navigation start -->
            <%
                String heading = "";
                if((request.getParameter("isSample") != null) && (request.getParameter("isSample").equals("0")))
                {
                     heading = "Sample Order";
                }
                else if((request.getParameter("quotation") != null) && (request.getParameter("quotation").equals("0")))
                {
                    heading = "Quote";
                }
                else
                {
                    heading = "Sales Order";
                }
            %>

        <%@ include file="/jsp/sales/sales_order_menu.jsp" %>
        <!-- end of the side navigations -->
        </TD>
        <TD bgcolor="#ffffff"><IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
        <TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
        <TD valign="top" width="100%">
            <IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
            <BR>
            <html:html>
            <table width=75%><tr><td><center><span class="NArialW">Approve Quote</span></center></td></tr></table>
            <img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10>
            <table border="0" width="95%" align=right>
            <%
                User user1 = (User) session.getAttribute (SessionKeys.USER_KEY);
                boolean hasMoodifyAction = true;
                if( !user1.isActionAllowed ( Functionality.SALES_NEW_QUOTATION, User.USER_ACTION_MODIFY ) ) {
                    hasMoodifyAction = false;
            %>
                <tr>
                    <td colspan=7 align='left'>
                        <font class='NArialS'><font color='blue'><b><%=Constants.NO_MODIFY_RIGHTS %></b></font></font>
                    </td>
                </tr>
            <% } %>
            <html:form name="QuotationForm" action="/approveQuotation" method="post" type="com.scalar.chiptrack.sales.forms.QuotationForm">
            <input type="hidden" name="quotation" value="<%=heading%>">
            <html:hidden name="QuotationForm" property="quotationId" />
                <tr>
                    <td>
                        <table border="0" width="75%" align=left>
                            <tr>
                                <td>
                                    <a name="#e1"></a>
                                </td>
                            </tr>
	                        <tr><td colspan="6" class="NArialL"><chiptrack:errors styleClass="NArialL"  /></td></tr>
                            <tr><td  colspan="6" align="left" class='NArialL'><FONT id="errors1" styleClass="NArialL" color='FF0000'></FONT></TD></TR>
                            <tr>
                                <td width="21%"><font class="NArialL">Quote No:</font></td>
                                <td width="21%" class="bodytext"><b><bean:write name="QuotationForm" property="quotationNo"  /></b></td>
                                <td width="3%">&nbsp;</td>
                                <td width="21%"><font class="NArialL">Customer Name :</font></td>
                                <td width="21%" class="bodytext"><b><bean:write name="QuotationForm" property="customerName" /></b></td>
                                <td width="13%">&nbsp;</td>
                            </tr>
                            <logic:iterate name="screenDisplayFiledsList" id="fieldProperty" type="com.scalar.chiptrack.commons.FieldProperty" indexId="idx">
                                <%
                                    if(idx.intValue()%2==0){
                                %>
                                <tr>
                                <%
                                    } else {
                                %>
                                    <td width="3%">&nbsp;</td>
                                <%
                                    }
                                %>
                                <logic:equal value="quoteType" property="fieldName" name="fieldProperty">
                                    <td width="21%"><font class="NArialL">Quote Type :</font></td>
                                   <td width="21%" class="bodytext"><b>
                                    <logic:notEqual value="-1" name="QuotationForm" property="quoteType">
                                            <bean:write name="QuotationForm" property="quoteType"/>
                                    </logic:notEqual>
                                   </b></td>
                                </logic:equal>
                                <logic:equal value="application" property="fieldName" name="fieldProperty">
                                    <td width="21%"><font class="NArialL">
                                   <logic:equal value="-2" name="QuotationForm" property="application"> Add New Application :</logic:equal>
                                   <logic:notEqual value="-2" name="QuotationForm" property="application"> Application :</logic:notEqual>
                                   </font></td>
                                   <td width="21%" class="bodytext"><b>
                                    <logic:equal value="-2" name="QuotationForm" property="application">
                                        <bean:write name="QuotationForm" property="addNewApplication" />
                                    </logic:equal>
                                    <logic:notEqual value="-2" name="QuotationForm" property="application">
                                        <logic:notEqual value="-1" name="QuotationForm" property="application">
                                            <bean:write name="QuotationForm" property="application" />
                                        </logic:notEqual>
                                    </logic:notEqual>
                                   </b></td>
                                </logic:equal>
                                <logic:equal value="projectName" property="fieldName" name="fieldProperty">
                                   <td width="21%"><font class="NArialL">Project Name :</font></td>
                                   <td width="21%" class="bodytext"><b>
                                            <bean:write name="QuotationForm" property="projectName"/>
                                   </b></td>
                                </logic:equal>
                                <logic:equal value="opportunityId" property="fieldName" name="fieldProperty">
                                    <td width="21%"><font class="NArialL">Opportunity ID :</font></td>
                                   <td width="21%" class="bodytext"><b>
                                            <bean:write name="QuotationForm" property="opportunityId"/>
                                   </b></td>
                                </logic:equal>
                                <%
                                    if(idx.intValue()%2==1){
                                %>
                                   <td width="3%">&nbsp;</td>
                                </tr>
                                <%
                                    }
                                %>
                            </logic:iterate>
                            
                            <tr>
                                <td width="21%"><font class="NArialL">Quote Revision :</font></td>
                                <td width="21%" class="bodytext"><bean:write name="QuotationForm" property="revision" /></td>
                                <td width="3%">&nbsp;</td>
                                <td width="21%">&nbsp;</td>
                                <td width="21%">&nbsp;</td>
                                <td width="13%">&nbsp;</td>
                            </tr>
                            <tr>
                                <td width="21%"><font class="NArialL"><bean:message key="label.sales.salesOrder.PoRevisionNumber"/> :</font></td>
                                <td width="21%" class="bodytext"><bean:write name="QuotationForm" property="poRev" /></td>
                                <td width="3%">&nbsp;</td>
                                <td width="21%"><font class="NArialL"><bean:message key="label.sales.salesOrder.PoDate"/> :</td>
                                <td width="21%" class="bodytext"><bean:write name="QuotationForm" property="poDate" />       </td>
                                <td width="13%">&nbsp;</td>
                            </tr>
                            <%--<bean:define id="quoteNo" name="QuotationForm" property="quotationNo" type="java.lang.String"/>
                            <tr><td colspan=4><font class="NArialL">Please <chiptrack:attachFile fileGroup="Quotation-PO" fileSubGroup="<%=quoteNo%>" formTitle="Attach Quotation PO" linkText="click here" allowAttach="<%=hasMoodifyAction%>" allowDelete="<%=hasMoodifyAction%>"/> to View and Attach PO</font></td></tr>--%>
                            <tr>
                                <td width="21%"><font class="NArialL"><bean:message key="label.sales.salesOrder.PoNumber"/>:&nbsp;</font></td>
                                <td width="21%" class="bodytext"><bean:write name="QuotationForm" property="customerPO" /></td>
                                <td width="3%">&nbsp;</td>
                                <td width="21%" class="NArialL"><bean:message key="label.sales.quotation.contactPerson"/> :</td>
                                <td width="21%" class="bodytext"><bean:write name="QuotationForm" property="contactPerson" /></td>
                                <td width="13%">&nbsp;</td>
                            </tr>
                            <tr>
                                <td width="21%"><font class="NArialL">Phone :</font></td>
                                <td width="21%" class="bodytext"><bean:write name="QuotationForm" property="phoneNumber" /></td>
                                <td width="3%">&nbsp;</td>
                                <td width="21%"><font class="NArialL">Cell Phone No :</font></td>
                                <td width="21%" class="bodytext"><bean:write name="QuotationForm" property="cellNumber" /></td>
                                <td width="13%">&nbsp;</td>
                            </tr>
                            <tr>
                                <td width="21%"><font class="NArialL">Fax :</font></td>
                                <td width="21%" class="bodytext"><bean:write name="QuotationForm" property="faxNumber" /></td>
                                <td width="3%">&nbsp;</td>
                                <td width="21%"><font class="NArialL">Email :</font></td>
                                <td width="21%" class="bodytext"><bean:write name="QuotationForm" property="email" /></td>
                                <td width="13%">&nbsp;</td>
                            </tr>
                            <tr>
                                <td width="21%" class="NArialL"><bean:message key="label.sales.quotation.salesPerson"/>:</td>
                                <td width="21%" class="bodytext"><bean:write name="QuotationForm" property="salesPerson" /></td>
                                <td width="3%">&nbsp;</td>
                                <td width="21%"><font class="NArialL"><bean:message key="label.sales.salesRep.Name"/> :</font></td>
                                <td width="21%" class="bodytext"><bean:write name="QuotationForm" property="salesRep" /></td>
                                <td width="13%">&nbsp;</td>
                            </tr>
                            <tr>
                                <td width="21%"><font class="NArialL"><bean:message key="label.sales.salesOrder.ShippingMethod" /> :</font></td>
                                <td width="21%" class="bodytext"> <bean:write name="QuotationForm" property="shippingMethod" /></td>
                                <td width="3%">&nbsp;</td>
                                <td width="21%">&nbsp;</td>
                                <td width="21%">&nbsp;</td>
                                <td width="13%">&nbsp;</td>
                            </tr>
                            <tr>
                                <td width="21%"><font class="NArialL">Pay Terms :</font></td>
                                <td width="21%" class="bodytext"> <bean:write name="QuotationForm" property="shippingTerms"  /></td>
                                <td width="3%">&nbsp;</td>
                                <td width="21%"><font class="NArialL"><bean:message key="label.sales.salesOrder.DeliveryTerms" /> :</font></td>
                                <td width="21%" class="bodytext"><bean:write name="QuotationForm" property="deliveryTerms"  /></td>
                                <td width="13%">&nbsp;</td>
                            </tr>
                            <tr>
                                <td width="21%" class="NArialL"><bean:message key="label.sales.quotation.regionalRep"/>:</td>
                                <td width="21%" class="bodytext"> <bean:write name="QuotationForm" property="regionalRep" /></td>
                                <td width="3%">&nbsp;</td>
                                <td width="21%"><font class="NArialL">Quote Date :</font></td>
                                <td width='21%' class="bodytext"><bean:write name="QuotationForm" property="quotationDate" />
                                <td width='13%'>&nbsp;</td>
                            </tr>
							<tr>
								<logic:equal value="-2" name="QuotationForm" property="endCustomerId">
								<td width="21%" class="NArialL">
									New <bean:message key="label.sales.endUser"/> :
								</td>
								<td width="21%" class="bodytext">
									<bean:write name="QuotationForm" property="newEndUserName"  />
								</td>
								</logic:equal>
								<logic:notEqual value="-2" name="QuotationForm" property="endCustomerId">
								<td width="21%" class="NArialL">
									<bean:message key="label.sales.endUser"/> :
								</td>
								<td width="21%" class="bodytext">
									<bean:write name="QuotationForm" property="endCustomer"  />
								</td>
								</logic:notEqual>
								<td width="3%">
									&nbsp;
								</td>
								<logic:equal value="-2" name="QuotationForm" property="odmId">
								<td width="27%" class="NArialL"> 
									New <bean:message key="label.sales.shipToCustomer"/>
								</td>
								<td width="21%" class="bodytext">
									<bean:write name="QuotationForm" property="newEndCustomerName" />
								</td>
								</logic:equal>
								<logic:notEqual value="-2" name="QuotationForm" property="odmId">
								<td width="27%" class="NArialL">
									<bean:message key="label.sales.shipToCustomer"/>
								</td>
								<td width="21%" class="bodytext">
									<bean:write name="QuotationForm" property="odm" />
								</td>
								</logic:notEqual>
								<td width="3%">
									&nbsp;
								</td>
							</tr>
                            <%--<tr>
                                <td width="21%"><font class="NArialL"><bean:message key="label.sales.endUser"/> :</font></td>
                                <td width="21%" class="bodytext"><bean:write name="QuotationForm" property="endCustomer" /></td>
                                <td width="3%">&nbsp;</td>
                                <td width="21%"><font class="NArialL"><bean:message key="label.sales.shipToCustomer"/></font></td>
                                <td width="21%" class="bodytext"><bean:write name="QuotationForm" property="odm" /></td>
                                <td width="13%">&nbsp;</td>
                            </tr>--%>
                            <tr>
                                <td width="21%" valign="top" class="NArialL">
									Billing Address :
								</td>
                                <td width="21%" class="bodytext">
									<% QuotationForm quotationForm = (QuotationForm) request.getAttribute("QuotationForm");%>
									<%= quotationForm.getBillingAddressAsHTML()%>
								</td>
                                <td width="3%">
									&nbsp;
								</td>
                                <td width="21%" valign="top" class="NArialL">
									Shipping Address :
								</td>
                                <td width="21%" class="bodytext">
									<%= quotationForm.getShippingAddressAsHTML()%>
								</td>
                                <td width="13%">
									&nbsp;
								</td>
                            </tr>
                            <tr><td colsapn=6><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></td></tr>
                            <tr>
                                <td width="21%"><font class="NArialL">Freight Instructions :</font></td>
                                <td width="21%" class="bodytext"><bean:write name="QuotationForm" property="freightInstructions"/></td>
                                <td width="3%">&nbsp;</td>
                                <td width="21%"><font class="NArialL">Shipping Instructions :</font></td>
                                <td width="21%" class="bodytext"><bean:write name="QuotationForm" property="shippingInstructions" /></td>
                                <td width="13%">&nbsp;</td>
                            </tr>
                            <tr><td colspan=6><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tr>
                            <tr>
                                <td width="21%"><font class="NArialL">Quotation Expires On :&nbsp;<font color=red>*</font></font></td>
                                <td width="21%" class="bodytext"><bean:write name="QuotationForm"  property="expiryDate" /></td>
                                <td width="3%">&nbsp;</td>
                                <td width="21%"><font class="NArialL">Comments :</font></td>
                                <td width="21%" class="bodytext"><bean:write name="QuotationForm" property="comments"  /></td>
                                <td width="13%">&nbsp;</td>
                            </tr>
                           <tr>
                                <td width="21%">&nbsp;</td>
                                <td width="21%">&nbsp;</td>
                                <td width="3%">&nbsp;</td>
                                <td width="21%">&nbsp;</td>
                                <td width="21%">&nbsp;</td>
                                <td width="13%">&nbsp;</td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <%
                    String commentsGroupId = "Quotation-" + quotationForm.getQuotationNo();
                %>
                <tr><td colspan=4><chiptrack:internalComments commentsGroupId="<%=commentsGroupId%>"/></td></tr>

                <tr><td colspan=6><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tr>
                <tr><td colspan='6' align="left" class='NArialL'><FONT id="errors" styleClass="NArialL" color='FF0000'></FONT></TD></TR>
                <tr><td colspan=6><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=5></td></tr>
                <% if(ConfigManager.isLoadQuotationQuestionnaire())
                {  %>
                <tr><td colspan=6><font class="NArialL"><a href="javascript:loadQuotationsQuestionnaire()" >Quotation Questionnaire View</a></font></td></tr>
                <%
                    }

                %>
                <tr>
                    <td colspan=6>
                        <br>&nbsp;<br>
                        <% int additionalColumns = 0; %>
                        <table border="0" width="95%" bordercolor="#FFFFFF">
                            <tr>
                                <td width="8%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Approve</font></font></td>
                                <td width="8%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Line Item</font></font></td>
                                <td width="8%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">PO Line Item</font></font></td>
                                <td width="20%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF"><bean:message key="label.mfgPartNumber" />*</font></font></td>
                                <td width="20%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF"><bean:message key="label.customerPartNumber"/></font></font></td>
                                <td width="20%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Description</font></font></td>
                                <td width='1%' align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Taxable</font></font></td>
                                <td width="14%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Req'd Dock Date<br><font size="-3">(mm/dd/yyyy)</font>&nbsp;*</font></font></td>
                                <td width="14%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Lead Time</font></font></td>
                                <td width="5%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Quantity&nbsp;*</font></font></td>
                                <%
                                    if(ConfigManager.isShowQuoteMinOrderQty()) {
                                        additionalColumns++;
                                %>
                                    <td width="5%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Min Order Quantity</font></font></td>
                                <%
                                    }
                                %>
                                <logic:equal value="true" name="QuotationForm" property="distributor">
                                    <%
                                        if ( ConfigManager.isShowQuoteRequestedPrice() )
                                        {
                                            additionalColumns++;
                                    %>
                                            <td width="10%" align="center" bgcolor="#993333" class="NArialL"><font color="#FFFFFF"><bean:message key="label.sales.requestedPrice"/></font></td>
                                    <%
                                        }
                                        if ( ConfigManager.isShowQuoteCustResalePrice() )
                                        {
                                            additionalColumns++;
                                    %>
                                            <td width="10%" align="center" bgcolor="#993333" class="NArialL"><font color="#FFFFFF"><bean:message key="label.sales.customerResalePrice"/></font></td>
                                    <%
                                        }
                                    %>
                                </logic:equal>
                                <td width="10%" align="center" bgcolor="#993333" class="NArialL"><font color="#FFFFFF"><bean:message key="label.sales.price"/></font></td>
                                <logic:equal value="true" name="QuotationForm" property="distributor">
                                    <%
                                        if ( ConfigManager.isShowQuoteSuggResalePrice() )
                                        {
                                            additionalColumns++;
                                    %>
                                            <td width="10%" align="center" bgcolor="#993333" class="NArialL"><font color="#FFFFFF"><bean:message key="label.sales.suggestedResalePrice"/></font></td>
                                    <%
                                        }
                                    %>
                                </logic:equal>
                                <td width="15%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Amount</font></font></td>
                            </tr>
                            <logic:iterate id="myHashMap" name="lineItemsWithSubtotals">
                            <logic:iterate id="lineItemList" name="myHashMap" >
                            <logic:iterate id="LineItem" name="lineItemList" property="key" type="com.scalar.chiptrack.sales.LineItem">
                            <tr>
                                <td width="8%" align="center" bgcolor="#DEE1E2">
                                    <logic:equal name="LineItem" property="isApproved" value="true">
                                    <logic:greaterThan name="LineItem" property="quantity" value="0">
                                        <font class="NArialL"><input type="checkbox" name="isApproved<bean:write name="LineItem" property="lineItemNo"/>" value="on" CHECKED disabled="true"></font>
                                    </logic:greaterThan>
                                    <logic:lessEqual name="LineItem" property="quantity" value="0">
                                        <font class="NArialL"><input type="checkbox" name="isApproved<bean:write name="LineItem" property="lineItemNo"/>" value="on" CHECKED disabled="true"></font>
                                    </logic:lessEqual>
                                    </logic:equal>

                                    <logic:equal name="LineItem" property="isApproved" value="false">
                                    <logic:greaterThan name="LineItem" property="quantity" value="0">
                                        <font class="NArialL"><input type="checkbox" name="isApproved<bean:write name="LineItem" property="lineItemNo"/>" value="on" onclick="enableDisableFields(<bean:write name="LineItem" property="lineItemNo"/>)"></font>
                                    </logic:greaterThan>
                                    <logic:lessEqual name="LineItem" property="quantity" value="0">
                                        <font class="NArialL"><input type="checkbox" name="isApproved<bean:write name="LineItem" property="lineItemNo"/>" value="on" disabled="true"></font>
                                    </logic:lessEqual>
                                    </logic:equal>
                                </td>
                                <td width="8%" bgcolor="#DEE1E2">
                                    <html:text name="LineItem" property="lineItemNo" size='6' styleClass="txfield" disabled="true"/>
                                    <html:hidden name="LineItem" property="lineItemId" />
                                    <html:hidden name="LineItem" property="lineItemNo" />
                                    <input type="hidden" name="jsLineItemNo" value="<%=LineItem.getLineItemNo()%>">
                                </td>
                                <td width="8%" bgcolor="#DEE1E2">
                                    <html:text name="LineItem" property="poLineItemNo" size='6' styleClass="txfield" disabled="true"/>
                                    <html:hidden name="LineItem" property="poLineItemNo" />
                                </td>
                                <td width="18%" bgcolor="#DEE1E2">
		                            <select name="manufacturingPartNo" class="txfield" onChange="getComments(<%=i%>)" disabled="true" >
                                    <option value="" ></option>
                                    <%
                                    strBuffer = new StringBuffer();
                                    for(int cnt=0;cnt<optionlist.size();cnt++)
                                    {
                                        option = (org.apache.struts.util.LabelValueBean)optionlist.get(cnt);
                                        if( (option.getValue().trim()).equalsIgnoreCase(LineItem.getManufacturingPartNo().trim()) )
                                        {
                                        strBuffer.append("<option value='").append(option.getValue()).append("' selected>");
                                        }
                                        else
                                        {
                                        strBuffer.append("<option value='").append(option.getValue()).append("'>");
                                        }
                                        strBuffer.append(option.getLabel()).append("</option>\n");
                                    }
                                    out.println(strBuffer);
                                    %>
                                    </select>
                                </td>
								<td width="18%" bgcolor="#DEE1E2">
									<font class="NArialL"><html:textarea name="LineItem" property="customerPartNo"  styleClass="txfield" disabled="true" /></font>
								</td>
								<td width="18%" bgcolor="#DEE1E2">
									<input type="hidden" name="">
									<font class="NArialL"><html:textarea name="LineItem" property="lineItemDescription"  styleClass="txfield" disabled="true" /></font>
								</td>
								<td width="5%" bgcolor="#DEE1E2" align=center>
									<logic:equal name="LineItem" property="isTaxable" value="true">
									<input type="checkbox" disabled="true" name=isTaxable<bean:write name="LineItem" property="lineItemNo"/> value="on" CHECKED>
									</logic:equal>

									<logic:equal name="LineItem" property="isTaxable" value="false">
									<input type="checkbox" disabled="true" name=isTaxable<bean:write name="LineItem" property="lineItemNo"/> value="on">
									</logic:equal>
								</td>
								<td width="14%" bgcolor="#DEE1E2">
									<html:text name="LineItem" property="requestDate" size='15' styleClass="txfield" disabled="true" />
								</td>
								<td width="5%" bgcolor="#DEE1E2">
                                    <select name='leadTime<bean:write name="LineItem" property="lineItemNo"/>' class="txfield" disabled="true">
                                        <option value="0">Select Lead Time</option>
                                        <%
                                            StringBuffer strBuffer1 = new StringBuffer();
                                        %>
                                        <logic:iterate id="leadTime" name="LineItem" property="leadTimeList" type="org.apache.struts.util.LabelValueBean">
                                            <%
                                                if ( leadTime.getValue().equalsIgnoreCase( LineItem.getLeadTime() ) )
                                                {
                                                    strBuffer1.append( "<option value='" ).append( leadTime.getValue() ).append( "'selected>" );
                                                }
                                                else
                                                {
                                                    strBuffer1.append( "<option value='" ).append( leadTime.getValue() ).append( "'>" );
                                                }
                                                strBuffer1.append(leadTime.getLabel()).append("</option>\n");
                                            %>
                                        </logic:iterate>
                                        <%
                                            out.println(strBuffer1);
                                        %>
                                    </select>

                                    <%--<html:select  name="LineItem" property="leadTime"  styleClass="txfield" disabled="true">
										<html:option value="0">Select Lead Time</html:option>
										<html:optionsCollection value="value" name="LineItem" property="leadTimeList" label="label"/>
									</html:select>--%>
								</td>
								<td width="5%" bgcolor="#DEE1E2">
									<html:text name="LineItem" property="quantity"  size='8' styleClass="valuetxfield" onchange="javascript:isValidInteger(this);" disabled="true" />
									<input type="hidden" name="oldQty" value="<%=LineItem.getQuantity()%>">
								</td>
                                <%
                                    if(ConfigManager.isShowQuoteMinOrderQty()) {
                                %>
                                    <td width="5%" bgcolor="#DEE1E2">
                                        <html:text name="LineItem" property="minOrderQty"  size='8' styleClass="valuetxfield" onchange="javascript:isValidInteger(this);" disabled="true" />
								    </td>
                                <%
                                    }
                                %>
                                <logic:equal value="true" name="QuotationForm" property="distributor">
                                <%
                                    if ( ConfigManager.isShowQuoteRequestedPrice() )
                                    {
                                %>
                                        <td width="10%" bgcolor="#DEE1E2"><html:text name="LineItem" property="reqPrice" size='12' styleClass="valuetxfield" disabled="true" /></td>
                                <%
                                    }
                                    if ( ConfigManager.isShowQuoteCustResalePrice() )
                                    {
                                %>
                                        <td width="10%" bgcolor="#DEE1E2"><html:text name="LineItem" property="custResalePrice" size='12' styleClass="valuetxfield" disabled="true" /></td>
                                <%
                                    }
                                %>
                                </logic:equal>
                                <td width="10%" bgcolor="#DEE1E2">
									<html:text name="LineItem" property="unitPriceAsDouble" size='12' styleClass="valuetxfield" disabled="true" />
								</td>
                                <logic:equal value="true" name="QuotationForm" property="distributor">
                                    <%
                                        if ( ConfigManager.isShowQuoteSuggResalePrice() )
                                        {
                                    %>
                                            <td width="10%" bgcolor="#DEE1E2" ><html:text name="LineItem" property="suggResalePrice" size='12' styleClass="valuetxfield" disabled="true" /></td>
                                    <%
                                        }
                                    %>
                                </logic:equal>
                                <td width="15%" bgcolor="#DEE1E2">
									<html:text name="LineItem" property="amountAsString" size='25' styleClass="valuetxfield" disabled="true"/>
								</td>
							</tr>
                                <% i++; %>
                            </logic:iterate>
							<tr>
								<bean:define id="subTotal" name="lineItemList" property="value" type="com.scalar.chiptrack.sales.SubTotal"/>

								<td colspan="9" width="15%" bgcolor="#FFFFFF" class="NArialL" align="right">
									Sub Total
								</td>
								<td colspan="1" width="15%" bgcolor="#FFFFFF" class="NArialL" align="right">
									<bean:write name="subTotal" property="subTotalQty" />
								</td>
								<td>&nbsp;</td>
								<td colspan="<%=(1+additionalColumns)%>" width="15%" bgcolor="#FFFFFF" class="NArialL" align="right">
									<bean:write name="subTotal" property="subTotalAmt" />
								</td>
							</tr>
							</logic:iterate>
							</logic:iterate>
							<tr><td colspan='11' align="left"><FONT id="font1"></FONT></TD></TR>
							<tr><td colspan="11">&nbsp;</td></tr>
							<tr>
								<td colspan="<%=(11+additionalColumns)%>" align="right" bgcolor="#FFFFFF" class="NArialL">Total</td>
								<td width="15%" align="center" bgcolor="#FFFFFF">&nbsp;<html:text name="QuotationForm" property="subTotalAsString" disabled="true" styleClass="valuetxfield" size="25"/></td>
							</tr>
							<tr>
								<td colspan="3" class="NArialL" align=right>Sales Tax State</td>
								<td class="NArialL">
									<html:select name="QuotationForm" property="salesTaxType" styleClass="txfield" onchange="javascript:addNewSalesTaxType(this);" disabled="true">
										<html:option value="0" >Non Taxable</html:option>
										<html:options collection="salesTaxes" property="value" labelProperty="label" />
										<html:option value="-1">Others</html:option>
									</html:select>
								</td>
								<td colspan="<%=(7+additionalColumns)%>" align=right class="NArialL">Sales Tax</td>
								<td width="15%" class="NArialL" >&nbsp;&nbsp;<html:text name="QuotationForm" property="salesTaxAsString" styleClass="valuetxfield"  size="25" disabled="true"/></td>
							</tr>
							<tr>
								<td colspan=6 align=right class="NArialL"><font class="NArialL"><FONT id="font-1"></FONT></font></td>
								<td class="NarialL" ><font class="NArialL"><FONT id="font-2"></FONT></font></td>
								<td colspan="<%=(4+additionalColumns)%>" align=right class="NArialL">Freight</td>
								<td width="15%" class="NArialL">$<html:text name="QuotationForm" property="frieghtAsDouble" styleClass="valuetxfield"  size="25" disabled="true" /></td>
							</tr>
							<tr>
								<td colspan=6 align=right class="NArialL"><font class="NArialL"><FONT id="font-3"></FONT></font></td>
								<td class="NarialL" ><font class="NArialL"><FONT id="font-4"></FONT></font></td>
								<td colspan="<%=(4+additionalColumns)%>" align=right class="NArialL"><html:text name="QuotationForm" property="miscName" styleClass="valuetxfield" disabled="true" /></td>
								<td width="15%" class="NArialL">$<html:text name="QuotationForm" property="miscAsDouble" styleClass="valuetxfield" size="25" disabled="true" /></td>
							</tr>
							<tr>
								<td colspan="<%=(11+additionalColumns)%>" align=right class="NArialL">Order Total</td>
								<td width="15%" class="NArialL">&nbsp;&nbsp;<html:text name="QuotationForm" property="orderTotalAsString" disabled="true" styleClass="valuetxfield" size="25"/></td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td colspan=6 align=center>
						<chiptrack:restrictedLink functionality='<%=Functionality.SALES_NEW_QUOTATION%>' action='<%=User.USER_ACTION_MODIFY%>' href="javascript:submitPage('SUBMIT');" >
							<img src="<%=chipTracContext%>/jsp/includes/images/submit.gif" onmouseover="window.status='Click to Approve the Quote';return true" title="Click here to Approve the Quote" onmouseout="window.status='';return true"  border='0'>
						</chiptrack:restrictedLink>
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<a href="javascript:resetForm()"><img src="<%=chipTracContext%>/jsp/includes/images/reset.gif"onmouseover="window.status='Click to Reset ';return true" title="Click here to Reset " onmouseout="window.status='';return true" border='0'></a>
					</td>
				</tr>
			</table>
			<html:hidden name="QuotationForm" property="customerName" />
			<html:hidden name="QuotationForm" property="quotationNo" />
			<html:hidden name="QuotationForm" property="customerId" />
			<html:hidden name="QuotationForm" property="billingAddressId" />
			<html:hidden name="QuotationForm" property="shippingMethodName" />
			<html:hidden name="QuotationForm" property="quotationDate"/>
			<input type="hidden" name="noofitems" value="<bean:write name="LineItem" property="lineItemNo" />">
			<input type="hidden" name="isSample" value="<%=request.getParameter("isSample")%>">
			<input type="hidden" name="action" value="">
            <input type="hidden" name="endCustomerId" value="<%= quotationForm.getEndCustomerId() %>"/>
            <input type="hidden" name="endCustomer" value="<%= quotationForm.getEndCustomer() %>"/>
            <input type="hidden" name="odm" value="<%= quotationForm.getOdm() %>">
            <input type="hidden" name="newEndUserName" value="<%= quotationForm.getNewEndUserName() %>">
            <input type="hidden" name="newEndCustomerName" value="<%= quotationForm.getNewEndCustomerName() %>">
            <input type="hidden" name="odmId" value="<%= quotationForm.getOdmId() %>">
            <input type="hidden" name="quotationType" value="<%= quotationForm.getQuotationType() %>"/>
            <input type="hidden" name="currentPrice" value="<%= quotationForm.getCurrentPrice() %>">
            <input type="hidden" name="currentPriceUnits" value="<%= quotationForm.getCurrentPriceUnits() %>">
            <input type="hidden" name="currentPriceUnitsType" value="<%= quotationForm.getCurrentPriceUnitsType() %>">
            <input type="hidden" name="currentPriceOthers" value="<%= quotationForm.getCurrentPriceOthers() %>">
            <input type="hidden" name="targetPrice" value="<%= quotationForm.getTargetPrice() %>">
            <input type="hidden" name="targetPriceUnitsType" value="<%= quotationForm.getTargetPriceUnitsType() %>">
            <input type="hidden" name="targetPriceUnits" value="<%= quotationForm.getTargetPriceUnits() %>">
            <input type="hidden" name="targetPriceOthers" value="<%= quotationForm.getTargetPriceOthers() %>">
            <input type="hidden" name="historyPricesInfo" value="<%= quotationForm.getHistoryPricesInfo() %>">
            <input type="hidden" name="contractPriceFlag" value="<%= quotationForm.isContractPriceFlag() %>">
            <%--<input type="hidden" name="contractPriceFilePath" value="<%= quotationForm.getContractPriceFilePath() %>">--%>
            <input type="hidden" name="contractPriceChangedReason" value="<%= quotationForm.getContractPriceChangedReason() %>">
            <input type="hidden" name="previousCommitments" value="<%= quotationForm.getPreviousCommitments() %>">
            <input type="hidden" name="previousCommitmentsPrice" value="<%= quotationForm.getPreviousCommitmentsPrice() %>">
            <input type="hidden" name="commitmentAddtionalInfo" value="<%= quotationForm.getCommitmentAddtionalInfo() %>">
            <input type="hidden" name="previousQuotation" value="<%= quotationForm.isPreviousQuotation() %>">
            <input type="hidden" name="previousQuotationDetails" value="<%= quotationForm.getPreviousQuotationDetails() %>">
            <%
                if( quotationForm.getPriceDiscountReason() != null && quotationForm.getPriceDiscountReason().length > 0 )
                {
                    for( int j=0; j<quotationForm.getPriceDiscountReason().length; j++ )
                    {
            %>
                        <input type="hidden" name="priceDiscountReason" value="<%= quotationForm.getPriceDiscountReason()[j] %>">
            <%
                    }
                }
                else
                {
            %>
                    <input type="hidden" name="priceDiscountReason" value="">
            <%
                }
            %>
            <input type="hidden" name="priceDiscountComments" value="<%= quotationForm.getPriceDiscountComments() %>">
            <input type="hidden" name="rebate" value="<%= quotationForm.isRebate() %>">
            <input type="hidden" name="rebateValue" value="<%= quotationForm.getRebateValue() %>">
            <input type="hidden" name="rebateOpertunity" value="<%= quotationForm.getRebateOpertunity() %>">
            <input type="hidden" name="rebateGoal" value="<%= quotationForm.getRebateGoal() %>">
            <input type="hidden" name="rebateTarget" value="<%= quotationForm.getRebateTarget() %>">
            <input type="hidden" name="rebateTargetValue" value="<%= quotationForm.getRebateTargetValue() %>">
            <input type="hidden" name="rebateVerifiedBy" value="<%= quotationForm.getRebateVerifiedBy() %>">
            <input type="hidden" name="competatior1" value="<%= quotationForm.getCompetatior1() %>">
            <input type="hidden" name="competatior1Others" value="<%= quotationForm.getCompetatior1Others() %>">
            <input type="hidden" name="competatior1Price" value="<%= quotationForm.getCompetatior1Price() %>">
            <input type="hidden" name="competatior1PriceUnit" value="<%= quotationForm.getCompetatior1PriceUnit() %>">
            <input type="hidden" name="competatior1Comments" value="<%= quotationForm.getCompetatior1Comments() %>">
            <input type="hidden" name="competatior2" value="<%= quotationForm.getCompetatior2() %>">
            <input type="hidden" name="competatior2Others" value="<%= quotationForm.getCompetatior2Others() %>">
            <input type="hidden" name="competatior2Price" value="<%= quotationForm.getCompetatior2Price() %>">
            <input type="hidden" name="competatior2PriceUnit" value="<%= quotationForm.getCompetatior2PriceUnit() %>">
            <input type="hidden" name="competatior2Comments" value="<%= quotationForm.getCompetatior2Comments() %>">
            <input type="hidden" name="distributorMargin" value="<%= quotationForm.getDistributorMargin() %>">
            <input type="hidden" name="marginDollars" value="<%= quotationForm.getMarginDollars() %>">
            <input type="hidden" name="totalPrevMargins" value="<%= quotationForm.getTotalPrevMargins() %>">
            <input type="hidden" name="marginReason" value="<%= quotationForm.getMarginReason() %>">
            <input type="hidden" name="prevQuotationNo" value="<%= quotationForm.getPrevQuotationNo() %>">
            <input type="hidden" name="contractPriceFileName" value="<%= quotationForm.getContractPriceFileName() %>">
            <input type="hidden" name="contractPriceFileNameWithPathWithPathEncoded" value="<%=chipTracContext%><%=quotationForm.getContractPriceFileNameWithPathEncoded()%>">
            <input type="hidden" name="currentPriceUnitsString" value="<%= quotationForm.getCurrentPriceUnitsString() %>">
            <input type="hidden" name="targetPriceUnitsString" value="<%= quotationForm.getTargetPriceUnitsString() %>">
            <input type="hidden" name="competatior1PriceUnitsType" value="<%= quotationForm.getCompetatior1PriceUnitsType() %>">
            <input type="hidden" name="competatior1PriceUnitOthers" value="<%= quotationForm.getCompetatior1PriceUnitOthers() %>">
            <input type="hidden" name="competatior2PriceUnitsType" value="<%= quotationForm.getCompetatior2PriceUnitsType() %>">
            <input type="hidden" name="competatior2PriceUnitOthers" value="<%= quotationForm.getCompetatior2PriceUnitOthers() %>">
            <input type="hidden" name="rebateTargetGoalTimeFrame" value="<%= quotationForm.getRebateTargetGoalTimeFrame() %>">
            <input type="hidden" name="rebateTargetGoalTimeFrameOthers" value="<%= quotationForm.getRebateTargetGoalTimeFrameOthers() %>">
            <input type="hidden" name="competatior1PriceUnitString" value="<%= quotationForm.getCompetatior1PriceUnitString() %>">
            <input type="hidden" name="competatior2PriceUnitString" value="<%= quotationForm.getCompetatior2PriceUnitString() %>">
            
        </html:form>
		</html:html>
		<BR><BR><BR>
		</TD>
		<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
	</TR>
</TABLE>
<!-- Footer starts here -->
<%@ include file="/jsp/includes/footer.jsp" %>
<!-- footer end here -->
<% if ( "false".equalsIgnoreCase((String)request.getAttribute("otherstateadded")) ) { %>
      	<script language="javascript">
      		addNewSalesTaxType(document.QuotationForm.salesTaxType);
      		document.QuotationForm.newSalesState.value = "<%=request.getAttribute("newsalesstate") %>"
      		document.QuotationForm.newSalesTax.value = "<%=request.getAttribute("newsalesvalue") %>"
      	</script>
<% } %>
<script language="javascript">var no = <%=i%>;

</script>
<script language="javascript">
 function checkValidity(field)
 {
    var field_vlaue = "";
    var field_focus = "";

    if(field == 'Contact Person') {
        field_vlaue = document.QuotationForm.contactPerson.value;
        field_focus = "contactPerson";
    }

    if(field == 'Sales Person') {
        field_vlaue = document.QuotationForm.salesPerson.value;
        field_focus = "salesPerson";
    }

    if(field == 'Regional Rep'){
        field_vlaue = document.QuotationForm.regionalRep.value;
        field_focus = "regionalRep";
    }

    if(field == 'End User'){
        field_vlaue = document.QuotationForm.endUser.value;
        field_focus = "endUser";
    }

    var pa=document.getElementById("errors");
    pa.innerHTML = "";

    for(i=0;i<field_vlaue.length;i++)
	{
			var str = field_vlaue.charAt(i)
            if ( (str == "$") || (str == "#") || (str == "(") || (str == ")") )
			{
      		  var errMsg = "* " + field +" can not contain #,$,(, and )  Characters";
              pa.innerHTML = errMsg;
              var obj = eval("document.QuotationForm."+field_focus);
              obj.focus();
              return false;
			}
	}
 }

function checkCustomerPONumber(field)
 {
    var field_vlaue = document.QuotationForm.customerPO.value;
    var field_focus = "customerPO";
    var pa=document.getElementById("errors");
    pa.innerHTML = "&nbsp;";

    for(i=0;i<field_vlaue.length;i++)
	{
			var str = field_vlaue.charAt(i)
            if(i==0 && str==" ")
            {
                var errMsg = "* " + field +" can not start with a space";
                pa.innerHTML = errMsg;
                var obj = eval("document.QuotationForm."+field_focus);
                obj.focus();
                return false;
            }
            if ((str == "$") || (str == "#") || (str == "(") || (str == ")") || (str == "&") || (str == ".") || (str == ","))
			{
      		  var errMsg = "* " + field +" can not contain # $ ( ) . , and &";
              pa.innerHTML = errMsg;
              var obj = eval("document.QuotationForm."+field_focus);
              obj.focus();
              return false;
			}
	}
 }
 function checkShipping(field)
 {
    var field_vlaue = "";
    var field_focus = "";

    if(field == 'Shipping Account') {
        field_vlaue = document.QuotationForm.shippingAccount.value;
        field_focus = "shippingAccount";
    }

    if(field == 'New Shipping Method') {
        field_vlaue = document.QuotationForm.newshippingMethod.value;
        field_focus = "newshippingMethod";
    }

    if(field == 'New Shipping Account'){
        field_vlaue = document.QuotationForm.newshippingAccount.value;
        field_focus = "newshippingAccount";
    }

    var pa=document.getElementById("errors");
    pa.innerHTML = "";

    for(i=0;i<field_vlaue.length;i++)
	{
			var str = field_vlaue.charAt(i)
            if ( (str == "$") || (str == "#") || (str == "(") || (str == ")") || (str == "&") || (str == ".") || (str == ",") )
			{
      		  var errMsg = "* " + field +" can not contain # $ ( ) . , and & Characters";
              pa.innerHTML = errMsg;
              var obj = eval("document.QuotationForm."+field_focus);
              obj.focus();
              return false;
			}
	}
 }

 function checkForDot(field)
 {
    var field_vlaue = document.QuotationForm.shippingTerms.value;
    var pa=document.getElementById("errors");
    pa.innerHTML = "";

    for(i=0;i<field_vlaue.length;i++)
	{
			var str = field_vlaue.charAt(i)
            if ( (str == ".") )
			{
    		  var errMsg = "* " + field +" can not contain . Character";
              pa.innerHTML = errMsg;
              document.QuotationForm.shippingTerms.focus();
              return false;
			}
	}
 }

 function checkForBraces(field)
 {
    var field_vlaue = document.QuotationForm.deliveryTerms.value;
    var pa=document.getElementById("errors");
    pa.innerHTML = "";

    for(i=0;i<field_vlaue.length;i++)
	{
			var str = field_vlaue.charAt(i)
            if ( (str == "(") || (str == ")") )
			{


    		  var errMsg = "* " + field +" can not contain '(' and ')' Characters";
              pa.innerHTML = errMsg;
              document.QuotationForm.deliveryTerms.focus();
              return false;
			}
	}
 }

 </script>
</BODY>
</HTML>
